import { createRouter, createWebHashHistory } from "vue-router";

let routes= [
    {
        path:"/",
        component:()=>import("../pages/home/index.vue"),
        name:"/",
        meta:{
            name:"导航首页",
            path:"/"
        },
        children:[
            {
                redirect:'/discover/playlist',
                path:"/discover",
                component:()=>import("../pages/discover/index.vue"),
                name:"discover",
                meta: {
                    name: '发现首页'
                },
                children: [
                    {
                        path: "playlist",
                        component: () => import("../pages/discover/playlist/index.vue"),
                        name: "playlist",
                        meta: {
                            name: "歌单"
                        }
                    }
                ]
            },
            {
                path: "mine",
                name: "mine",
                meta: {
                    name: "个人中心",
                },
                component: () => import("../pages/mine/index.vue")
            },
            {
                props: true,
                path: "friend/:id",
                name: "friend",
                meta: {
                    name: "我的朋友"
                },
                component: () => import("../pages/friend/index.vue")
            }
        ]
    },
    {
        path: "/login",
        name: "login",
        meta: {
            name: "登入页面"
        },
        component: () => import("../pages/login/index.vue")
    }
]

const router = createRouter({
    history:createWebHashHistory("/base"),
    routes
})

export default router